package com.lagou.dao.impl;

import com.lagou.dao.SectionDao;
import com.lagou.domain.Section;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class SectionDaoImpl implements SectionDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    //添加章节方法
    public void saveSection(Section section) {

        String sql = "insert into section values(null,?,?,?)";
        jdbcTemplate.update (sql,section.getCourse_id (),section.getSection_name (),section.getDescription ());

    }
}
